package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsDao {

//    @Select("select * from tb_goods")  使用注解开发测试成功,
//    现在测试不用注解开发
    List<Goods> findGoods(String name);

    @Insert("insert into tb_goods value(null, #{name},#{remark},now())")
    Integer insertGoods(Goods goods);

    Integer updateGoods(Goods goods);

    @Delete("delete from tb_goods where id = #{id}")
    Integer deleteGoods(Integer id);

}
